<template>
    <van-nav-bar
  title="标题"
  left-text="返回"
  left-arrow
  @click-left="onClickLeft"
  fixed
/><van-skeleton title :row="3" />
<div style="height: 45px;width: 370px;"></div>
<!-- <van-search
  v-model="value"
  shape="round"
  background="#4fc08d"
  placeholder="请输入搜索关键词"
  @search="onSearch"
/> -->
    <div v-for="item in searchApiData">
        <router-link :to="{name:'dd',params:{goods_id:item.goods_id}}">
<van-card
  :price="item.goods_price"
  :title="item.goods_name"
  :thumb="item.goods_big_logo?item.goods_big_logo:'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'"
/>
</router-link>
<van-button type="primary" is-link @click="showPopup" class="aa">规格</van-button>
<van-popup v-model:show="show" :style="{ padding: '64px' }">内容</van-popup>
    </div>
    <van-submit-bar :price="3050" button-text="提交订单" @submit="onSubmit" />
</template>

<script setup>
import router from '@/router';
import { searchApi } from '@/api/api';
import { ref } from 'vue';
import { useRoute } from 'vue-router';
let route=useRoute()
console.log(route.params.query);

let searchApiData=ref([])
searchApi(route.params.query).then(res=>{
    searchApiData.value=res.data.message.goods
    console.log(res);
    
})
const onSearch=()=>{
    router.push('/ss')
}
const onSubmit=()=>{
    router.push('/didan')
}
const onClickLeft = () => history.back();

    const show = ref(false);
    const showPopup = () => {
      show.value = true;
    };
    import { useCounterStore } from '@/stores/counter'
// 在组件内部的任何地方均可以访问变量 `store` ✨
const store = useCounterStore()
</script>

<style scoped>
.aa{
   margin-left: 300px;
}
</style>